---
title: "CLI Configuration"
description: Configure your Hot Updater CLI to connect to your self-hosted server.
icon: Settings
version: "v0.22.0"
---

## Overview

Your CLI configuration (`hot-updater.config.ts`) connects your React Native project to your self-hosted Hot Updater server. This file defines how bundles are built, stored, and tracked.

## Basic Configuration

Create a `hot-updater.config.ts` file in your React Native project root:

```typescript title="hot-updater.config.ts"
import { defineConfig } from "@hot-updater/core";
import { bare } from "@hot-updater/bare";
import { s3Storage } from "@hot-updater/aws";
import { standaloneRepository } from "@hot-updater/standalone";

export default defineConfig({
  build: bare(),
  storage: s3Storage({
    region: "auto",
    endpoint: process.env.R2_ENDPOINT,
    credentials: {
      accessKeyId: process.env.R2_ACCESS_KEY_ID!,
      secretAccessKey: process.env.R2_SECRET_ACCESS_KEY!,
    },
    bucketName: process.env.R2_BUCKET_NAME!,
  }),
  database: standaloneRepository({
    baseUrl: "http://localhost:3000/hot-updater",
  }),
});
```

<Callout type="warn">
**Critical: Storage Plugin Must Match**

The `storage` plugin in your CLI config must match the `storages` in your server's `createHotUpdater` configuration.

**CLI uses `s3Storage` → Server must use `s3Storage`**

Both sides need the same plugin type and configuration to encode/decode storage URIs correctly.
</Callout>

## Standalone Repository Configuration

The `standaloneRepository` plugin connects your CLI to your self-hosted server:

```typescript
interface StandaloneRepositoryConfig {
  baseUrl: string;                        // Your server URL
  commonHeaders?: Record<string, string>; // Optional headers (e.g., authentication)
  routes?: Routes;                        // Optional custom route configuration
}
```

### Basic Example

```typescript
database: standaloneRepository({
  baseUrl: "http://localhost:3000/hot-updater",
})
```

### With Authentication

```typescript
database: standaloneRepository({
  baseUrl: process.env.HOT_UPDATER_SERVER_URL!,
  commonHeaders: {
    "Authorization": `Bearer ${process.env.API_TOKEN}`
  }
})
```

### With Custom Routes

```typescript
database: standaloneRepository({
  baseUrl: "https://api.example.com",
  routes: {
    upsert: () => ({
      path: "/v1/hot-updater/api/bundles",
      headers: { "X-Custom-Header": "value" }
    }),
    list: () => ({
      path: "/v1/hot-updater/api/bundles"
    }),
    retrieve: (bundleId) => ({
      path: `/v1/hot-updater/api/bundles/${bundleId}`
    }),
    delete: (bundleId) => ({
      path: `/v1/hot-updater/api/bundles/${bundleId}`
    })
  }
})
```

## API Endpoints

Your server must implement these endpoints (when using default routes):

| Method | Endpoint | Description |
|--------|----------|-------------|
| POST | `/hot-updater/api/bundles` | Create or update bundles |
| GET | `/hot-updater/api/bundles` | List bundles (query: channel, platform, limit, offset) |
| GET | `/hot-updater/api/bundles/:id` | Get bundle by ID |
| DELETE | `/hot-updater/api/bundles/:id` | Delete bundle |
| GET | `/hot-updater/api/bundles/channels` | List all channels |

These endpoints are automatically created when you use `@hot-updater/server` with database adapters.

## Next Steps

**Choose your build and storage plugins:**
- [Build Plugins](../build-plugins/bare) - React Native CLI, Expo, Re.Pack
- [Storage Plugins](../storage-plugins/supabase) - AWS S3, Supabase, Firebase, Cloudflare R2

**Set up your server:**
- [Quick Start Guide](./quick-start) - Set up a server in 5 minutes
- [Database Adapters](./database/drizzle) - Drizzle, Prisma, Kysely, MongoDB
- [Server Frameworks](./frameworks/hono) - Hono, Express, Elysia
- [Overview](./overview) - Learn about the architecture
